package com.cmhi.base.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.cmhi.base.entity.ShareInfo;
import com.cmhi.base.provider.BimDataManager;
import com.cmhi.softcoredata.tools.CmhiInterface;

public class BmService extends Service {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return mbhInterface;
    }
    private final CmhiInterface.Stub mbhInterface = new CmhiInterface.Stub() {
        @Override
        public String getEPGToken()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_EPG_TOKEN);
        }

        @Override
        public String getStbId()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_STB_ID);
        }

        @Override
        public String getSN()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_SN);
        }

        @Override
        public String getVirtualMac()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_VIRTUAL_MAC);
        }

        @Override
        public String getUserAccount()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_USER_ACCOUNT);
        }

        @Override
        public String getUserPhone()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_USER_PHONE);
        }

        @Override
        public String getUserType()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_USER_TYPE);
        }

        @Override
        public String getProvinceCode()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_PROVINCE_CODE);
        }

        @Override
        public String getCityCode()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_CITY_CODE);
        }

        @Override
        public String getAreaCode()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_AREA_CODE);
        }

        @Override
        public String getDistrictName()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_DISTRICT_NAME);
        }

        @Override
        public String getBroadbandAccount()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_BROADBAND_ACCOUNT);
        }

        @Override
        public String getLauncher()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_LAUNCHER);
        }

        @Override
        public String getSettingAction()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_SETTING_ACTION);
        }

        @Override
        public String getPlayerVersion()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_PLAYER_VERSION);
        }

        @Override
        public String getDeviceMediaInfo()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_DEVICE_MEDIA_INFO);
        }

        @Override
        public String getBIZMoudel()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_BIZ_MOUDEL);
        }

        @Override
        public String getUserState()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_USER_STATE);
        }

        @Override
        public String getTVMac()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_TV_MAC);
        }

        @Override
        public String getTVID()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_TV_ID);
        }

        @Override
        public String getOTTTerminalType()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_OTT_TERMINAL_TYPE);
        }

        @Override
        public String getOTTTerminalBrand()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_OTT_TERMINAL_BRAND);
        }

        @Override
        public String getChannelType()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_CHANNEL_TYPE);
        }

        @Override
        public String getIsSoftTerminal()  {
            return BimDataManager.getShareInfoManager().getValue(ShareInfo.KEY_IS_SOFT_TERMINAL);
        }

        @Override
        public String getExtendValue(String s)  {
            if(TextUtils.isEmpty(s)){
                return "";
            }
            return BimDataManager.getShareInfoManager().getValue(s);
        }
    };
}
